﻿/*************************************************
 * 
 *  框架执行SQL语句通用类
 * 
 *  create by ternence
 * 
 *  create datetime at 2017-03-17
 *  
 *  西安佳卓信息科技有限公司 ©2017
 * 
 * ***********************************************/
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using System.Data;
using Zor_Modes;
using Zor_IDAL;


namespace Zor_DAL
{
    public static class DapperHelp<T> where T:class
    {

        public static List<Sys_Navigations> GetUser()
        {
            List<Sys_Navigations> dy = DapperQuery<Sys_Navigations>.DoQueryList("select * from [dbo].[Sys_Navigations]", null);
            return dy;
        }

        public static List<T> GetPagerList(int index, out int TotalCount)
        {
            BasePager pages = new BasePager();
            pages.TableName = "Sys_Navigations";
            pages.Where = "1=1";
            pages.Order = "Nav_Id";
            pages.PageSize = 15;
            pages.CurrentCount = (index - 1) * 15;

            return DapperPage<T>.PageList(pages, out TotalCount);
        }
    }

}
